/**
 * @description 创建用户 dto
 * @author LI
 * @date 2020-11-12 13:04
 */
import { IsEmail, IsNotEmpty } from 'class-validator'
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'

export class CreateUserDto {
  @ApiPropertyOptional({ description: '昵称', example: '默认昵称' })
  readonly nickName?: string

  @ApiProperty({ description: '头像', required: false })
  readonly photoUrl?: string

  @ApiProperty({ description: '登录邮箱', example: '123@qq.com' })
  @IsNotEmpty({ message: '邮箱不能为空' })
  @IsEmail({}, { message: '邮箱格式不正确' })
  readonly loginEmail: string

  @ApiProperty({ description: '登录密码', example: '123456' })
  @IsNotEmpty({ message: '密码不能为空' })
  readonly password: string

  @ApiProperty({ description: '验证码' })
  @IsNotEmpty({ message: '验证码不能为空' })
  readonly code: number

}